package org.travel.api.travel.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.Objects;

@Entity
public class Room implements Serializable {
    private int roomId;

/*
    private int hotelid;
*/

    private Hotel hotel;

    private String roomType;
    private String roomImg;
    private String roomOtherImg;
    private BigDecimal roomPrice;
/*
    private int dicId;
*/
    private Dictionaries dictionaries;
    private Integer isHavingBreakfast;
    private int payType;
    private int roomIsYd;
    private int roomIsCancel;
    private Date roomCreateDate;
    private Date roomModifyDate;

    @Id
    @Column(name = "roomId")
    public int getRoomId() {
        return roomId;
    }

    public void setRoomId(int roomId) {
        this.roomId = roomId;
    }

    /*public int getHotelid() {
        return hotelid;
    }

    public void setHotelid(int hotelid) {
        this.hotelid = hotelid;
    }*/

    @Basic
    @Column(name = "roomType")
    public String getRoomType() {
        return roomType;
    }

    public void setRoomType(String roomType) {
        this.roomType = roomType;
    }

    @Basic
    @Column(name = "roomImg")
    public String getRoomImg() {
        return roomImg;
    }

    public void setRoomImg(String roomImg) {
        this.roomImg = roomImg;
    }

    @Basic
    @Column(name = "roomOtherImg")
    public String getRoomOtherImg() {
        return roomOtherImg;
    }

    public void setRoomOtherImg(String roomOtherImg) {
        this.roomOtherImg = roomOtherImg;
    }

    @Basic
    @Column(name = "roomPrice")
    public BigDecimal getRoomPrice() {
        return roomPrice;
    }

    public void setRoomPrice(BigDecimal roomPrice) {
        this.roomPrice = roomPrice;
    }

    /*@Basic
    @Column(name = "dicId")
    public int getDicId() {
        return dicId;
    }

    public void setDicId(int dicId) {
        this.dicId = dicId;
    }*/

    @Basic
    @Column(name = "isHavingBreakfast")
    public Integer getIsHavingBreakfast() {
        return isHavingBreakfast;
    }

    public void setIsHavingBreakfast(Integer isHavingBreakfast) {
        this.isHavingBreakfast = isHavingBreakfast;
    }

    @Basic
    @Column(name = "payType")
    public int getPayType() {
        return payType;
    }

    public void setPayType(int payType) {
        this.payType = payType;
    }

    @Basic
    @Column(name = "roomIsYD")
    public int getRoomIsYd() {
        return roomIsYd;
    }

    public void setRoomIsYd(int roomIsYd) {
        this.roomIsYd = roomIsYd;
    }

    @Basic
    @Column(name = "roomIsCancel")
    public int getRoomIsCancel() {
        return roomIsCancel;
    }

    public void setRoomIsCancel(int roomIsCancel) {
        this.roomIsCancel = roomIsCancel;
    }

    @Basic
    @Column(name = "roomCreateDate")
    public Date getRoomCreateDate() {
        return roomCreateDate;
    }

    public void setRoomCreateDate(Date roomCreateDate) {
        this.roomCreateDate = roomCreateDate;
    }

    @Basic
    @Column(name = "RoomModifyDate")
    public Date getRoomModifyDate() {
        return roomModifyDate;
    }

    public void setRoomModifyDate(Date roomModifyDate) {
        this.roomModifyDate = roomModifyDate;
    }

    @ManyToOne
    @JoinColumn(name = "hotelid")
    public Hotel getHotel() {
        return hotel;
    }

    public void setHotel(Hotel hotel) {
        this.hotel = hotel;
    }

    @ManyToOne
    @JoinColumn(name = "dicId")
    public Dictionaries getDictionaries() {
        return dictionaries;
    }

    public void setDictionaries(Dictionaries dictionaries) {
        this.dictionaries = dictionaries;
    }

    /* @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Room room = (Room) o;
        return roomId == room.roomId &&
                dicId == room.dicId &&
                payType == room.payType &&
                roomIsYd == room.roomIsYd &&
                roomIsCancel == room.roomIsCancel &&
                Objects.equals(hotelid, room.hotelid) &&
                Objects.equals(roomType, room.roomType) &&
                Objects.equals(roomImg, room.roomImg) &&
                Objects.equals(roomOtherImg, room.roomOtherImg) &&
                Objects.equals(roomPrice, room.roomPrice) &&
                Objects.equals(isHavingBreakfast, room.isHavingBreakfast) &&
                Objects.equals(roomCreateDate, room.roomCreateDate) &&
                Objects.equals(roomModifyDate, room.roomModifyDate);
    }

    @Override
    public int hashCode() {

        return Objects.hash(roomId, hotelid, roomType, roomImg, roomOtherImg, roomPrice, dicId, isHavingBreakfast, payType, roomIsYd, roomIsCancel, roomCreateDate, roomModifyDate);
    }*/
}
